package com.loan.system.create.service.impl;

import com.loan.common.utils.DateUtils;
import com.loan.system.create.domain.AssistPdfCreateFile;
import com.loan.system.create.mapper.AssistPdfCreateFileMapper;
import com.loan.system.create.service.IAssistPdfCreateFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * PDF文件生成记录Service业务层处理
 *
 * @author Sophia
 * @date 2024-08-12
 */
@Service
public class AssistPdfCreateFileServiceImpl implements IAssistPdfCreateFileService {
    @Autowired
    private AssistPdfCreateFileMapper assistPdfCreateFileMapper;

    /**
     * 查询PDF文件生成记录
     *
     * @param id PDF文件生成记录主键
     * @return PDF文件生成记录
     */
    @Override
    public AssistPdfCreateFile selectAssistPdfCreateFileById(Long id) {
        return assistPdfCreateFileMapper.selectAssistPdfCreateFileById(id);
    }

    /**
     * 查询PDF文件生成记录列表
     *
     * @param assistPdfCreateFile PDF文件生成记录
     * @return PDF文件生成记录
     */
    @Override
    public List<AssistPdfCreateFile> selectAssistPdfCreateFileList(AssistPdfCreateFile assistPdfCreateFile) {
        return assistPdfCreateFileMapper.selectAssistPdfCreateFileList(assistPdfCreateFile);
    }

    /**
     * 新增PDF文件生成记录
     *
     * @param assistPdfCreateFile PDF文件生成记录
     * @return 结果
     */
    @Override
    public int insertAssistPdfCreateFile(AssistPdfCreateFile assistPdfCreateFile) {
        assistPdfCreateFile.setCreateTime(DateUtils.getNowDate());
        return assistPdfCreateFileMapper.insertAssistPdfCreateFile(assistPdfCreateFile);
    }

    /**
     * 修改PDF文件生成记录
     *
     * @param assistPdfCreateFile PDF文件生成记录
     * @return 结果
     */
    @Override
    public int updateAssistPdfCreateFile(AssistPdfCreateFile assistPdfCreateFile) {
        assistPdfCreateFile.setUpdateTime(DateUtils.getNowDate());
        return assistPdfCreateFileMapper.updateAssistPdfCreateFile(assistPdfCreateFile);
    }

    /**
     * 批量删除PDF文件生成记录
     *
     * @param ids 需要删除的PDF文件生成记录主键
     * @return 结果
     */
    @Override
    public int deleteAssistPdfCreateFileByIds(Long[] ids) {
        return assistPdfCreateFileMapper.deleteAssistPdfCreateFileByIds(ids);
    }

    /**
     * 删除PDF文件生成记录信息
     *
     * @param id PDF文件生成记录主键
     * @return 结果
     */
    @Override
    public int deleteAssistPdfCreateFileById(Long id) {
        return assistPdfCreateFileMapper.deleteAssistPdfCreateFileById(id);
    }
}
